from time import sleep

def task1():
    for i in range(3):
        print('a-----{}'.format(i))
        yield
        sleep(0.1)

def task2():
    for i in range(3):
        print('b-----{}'.format(i))
        yield
        sleep(10)

if __name__ == '__main__':
    t1=task1()
    t2=task2()

    while True:
        try:
            next(t1)
            next(t2)
        except:
            break

